package org.metasketch.simulator.perspective;

import javafx.scene.paint.Color;
import javafx.scene.shape.Rectangle;

import org.metasketch.editor.Editor;
import org.metasketch.editor.Project;
import org.metasketch.editor.perspectives.ILayout;
import org.metasketch.editor.perspectives.SimplePerspectiveManager;
import org.metasketch.editor.project.MultipleProject;

public class SimulationLayout implements ILayout {

	SimplePerspectiveManager manager;

	MiniPerspectiveChooser chooser;

	Rectangle rightTop = new Rectangle(10, 10, Color.BLACK);

	public SimulationLayout(SimplePerspectiveManager manager) {
		this.manager = manager;
		chooser = new MiniPerspectiveChooser(manager);
	}

	@Override
	public void setup(Project project) {
		if (!(project instanceof MultipleProject))
			return;

		chooser.setup(project);
		// manager.setProject();

	}

	@Override
	public void apply(Object editorO) {

		Editor editor = (Editor) editorO;

		// chooser.setPane();
		// chooser.setup(editor.getCenter());
		chooser.setPane(editor.getCenter());
		editor.getLeft().setTop(chooser);

		chooser.update();

		// editor.getLeft().setTop(toolbox);
		//
		// editor.getCenter().setCenter(diagramViewer);
		//
		// editor.getRight().setTop(diagramTypeCreator);
		// editor.getRight().setCenter(modelViewer);
		editor.getRight().setTop(rightTop);
	}

	// @Override
	// public void setProject(Editor editor, Project project) {
	// setup(editor);
	// }

}
